package com.config;

import com.alibaba.druid.pool.DruidDataSource;
import com.zaxxer.hikari.HikariDataSource;
import io.seata.rm.datasource.xa.DataSourceProxyXA;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

import javax.sql.DataSource;

/**
 * @description:
 * @author: sksun2
 * @create: 2023-07-26
 */
@Configuration
public class Config {

    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

//    @Bean(name = "druidDataSource")
//    @ConfigurationProperties(prefix = "spring.datasource")
//    public DruidDataSource druidDataSource(){
//        return new DruidDataSource();
//    }

//    @Bean("dataSource")
//    public DataSource dataSource(DruidDataSource druidDataSource) {
//        // DataSourceProxy for AT mode
//        // return new DataSourceProxy(druidDataSource);
//
//        // DataSourceProxyXA for XA mode
//        return new DataSourceProxyXA(druidDataSource);
//    }



}
